<?php include($folder.'/layouts/templates/backend/header.tpl') ?>
<?php
$master['toolbarItems'] = array(
	'<input type="button" onclick="javascript:if (confirm(\'Biztos, hogy törölni szeretnéd a napló tartalmát?\')) { location.href = \''.$prefix.'/adminisztracio/naplo/latogatas-torles\' }" class="button" value="Látogatás napló törlése" />',
	'<input type="button" onclick="javascript:if (confirm(\'Biztos, hogy törölni szeretnéd a napló tartalmát?\')) { location.href = \''.$prefix.'/adminisztracio/naplo/belepes-torles\' }" class="button" value="Belépés napló törlése" />'
);
?>	
<script type="text/javascript">
function LoginTryDelete(itemID)
{
	SubmitForm('login_try_delete', {'loginTryToDelete':itemID}) 
}
function LogDelete(itemID)
{
	SubmitForm('log_delete', {'logToDelete':itemID}) 
}
</script>
<?php include($folder.'/layouts/templates/backend/middle.tpl') ?>
<?php $content['itemsPerPage2'] = $content['itemsPerPage'] = 16; ?>
<?php if (!empty($_SESSION['id'])): ?>
<input type="hidden" name="loginTryToDelete" id="loginTryToDelete" />
<input type="hidden" name="logToDelete" id="logToDelete" />
<?php echo extendedTable(array(
	'header' => paginator(array(
		'id' => 'main',
		'selectCountMethod' => 'naplo_select_count',
		'itemsPerPage' => $content['itemsPerPage'],
		'itemsPerPageAll' => array(8,16,24,32,64,128))),
	'body' => table(array(
		'noRowsMessage' => 'A látogatás napló üres.',
		'id' => 'main',
		'wrap' => false,
		'itemsPerPage' => $content['itemsPerPage'],
		'sortColumn' => 'created',
		'sortDirection' => 'desc',
		'selectMethod' => 'naplo_select',
		'columns' => array(
			array(
				'title' => '', 
				'template' => '<a href="javascript:LogDelete({id})">törlés</a>',
				// 'width' => '50px', 
				'align' => 'center', 
				'sortColumn' => ''
			),
			array(
				'title' => 'hoszt',
				'template' => '{host}',
				// 'width' => '240px',
				'align' => 'left',
				'sortColumn' => 'host'
			),
			array(
				'title' => 'IP-cím',
				'template' => '{address}',
				// 'width' => '120px',
				'align' => 'center',
				'sortColumn' => 'address'
			),
			array(
				'title' => 'időpont',
				'template' => '{created}',
				// 'width' => '160px',
				'align' => 'center',
				'sortColumn' => 'created'
			),
			array(
				'title' => 'URL',
				'template' => '<a href="http://'.$_SERVER['HTTP_HOST'].'{request}">{request}</a>',
				// 'width' => '240px',
				'align' => 'center',
				'wrap' => false,
				'sortColumn' => 'request'
			),
			array(
				'title' => 'előzmény',
				'template' => '<a href="{referer}">{referer}</a>',
				// 'width' => '280px',
				'align' => 'center',
				'sortColumn' => 'referer'
			)
		)
	)),
	'footer' => paginator(array(
		'id' => 'main',
		'isFirst' => false,
		'selectCountMethod' => 'naplo_select_count',
		'itemsPerPage' => $content['itemsPerPage'],
		'itemsPerPageAll' => array(8,16,24,32,64,128))))) ?>
<br />
<?php echo extendedTable(array(
	'header' => paginator(array(
		'id' => 'login_try',
		'selectCountMethod' => 'login_try_select_count',
		'itemsPerPage' => $content['itemsPerPage2'],
		'itemsPerPageAll' => array(8,16,24,32,64,128))),
	'body' => table(array(
		'noRowsMessage' => 'A belépés napló üres.',
		'id' => 'login_try',
		'itemsPerPage' => $content['itemsPerPage2'],
		'sortColumn' => 'datetime',
		'sortDirection' => 'desc',
		'selectMethod' => 'login_try_select',
		'columns' => array(
			array(
				'title' => '', 
				'template' => '<a href="javascript:LoginTryDelete({id})">törlés</a>',
				'width' => '50px', 
				'align' => 'center', 
				'sortColumn' => ''
			),
			array(
				'title' => 'hoszt',
				'template' => '{host}',
				'width' => '240px',
				'align' => 'left',
				'sortColumn' => 'host'
			),
			array(
				'title' => 'IP-cím',
				'template' => '{address}',
				'width' => '120px',
				'align' => 'center',
				'sortColumn' => 'address'
			),
			array(
				'title' => 'jelszó',
				'template' => '{password}',
				'width' => '160px',
				'align' => 'center',
				'sortColumn' => 'password'
			),
			array(
				'title' => 'időpont',
				'template' => '{datetime}',
				'width' => '160px',
				'align' => 'center',
				'sortColumn' => 'datetime'
			)))),
	'footer' => paginator(array(
		'isFirst' => false,
		'id' => 'login_try',
		'selectCountMethod' => 'login_try_select_count',
		'itemsPerPage' => $content['itemsPerPage2'],
		'itemsPerPageAll' => array(8,16,24,32,64,128))))) ?>
<?php endif; ?>
<?php include($folder.'/layouts/templates/backend/footer.tpl') ?>